<style>
#banner_action_montaj {
	width:491px;
	height:238px;
	background:url(/images/banner_action.png);
	position:relative;
	margin:0px auto;
}
#banner_action_montaj .countdown {
	position:absolute;
	top:40px;
	right:27px;
	width:200px;
	height:22px;
}
#banner_action_montaj .countdown table {
	border-collapse:collapse;
	font-style:normal;
	color: #663333;
}
#banner_action_montaj .countdown table td {
	padding:0px;
	margin:0px;
	text-align:center; 
}
#banner_action_montaj .countdown table td.n {
	background-color: #663333;
	color:white;
	min-width:43px;
	padding-top:2px;
}

#banner_action_montaj a.banner {
	position:absolute;
	top:0px;
	left:0px;
	width:491px;
	height:238px;
}
#banner_action_montaj a.ask_for_call {
	position:absolute;
	top:167px;
	left:160px;
	width:176px;
	height:35px;
}


#banner_action_montaj .phone_name {
	display:none;
	position:absolute;
	top:19px;
	left:25px;
	width:447px;
	height:195px;
	background-color:#433238;
	color:white;
	text-align:center;
}
#banner_action_montaj .phone_name table {
	position:relative;
	margin: 30px auto;
}
#banner_action_montaj .phone_name table tr td:first-child {
	text-align:right;
}
</style>

<script>
function updateActionMontajCountdown(){
	var now = new Date();
	var end = new Date(2013,1,20,0,0,0);
	while (now > end) {
		end.setDate(end.getDate() + 20);
	}
	var delta = end.getTime() - now.getTime();
	var days = Math.floor(delta / 1000 / 60 / 60 / 24);
	var hours = Math.floor((delta / 1000 / 60 / 60) % 24);
	var mins = Math.floor((delta / 1000 / 60) % 60);
	var secs = Math.floor((delta / 1000) % 60);

	$('#banner_action_montaj .countdown table tr:first-child td:nth-child(1)').html((''+days).length > 1 ? days : '0'+days);
	$('#banner_action_montaj .countdown table tr:first-child td:nth-child(3)').html((''+hours).length > 1 ? hours : '0'+hours);
	$('#banner_action_montaj .countdown table tr:first-child td:nth-child(5)').html((''+mins).length > 1 ? mins : '0'+mins);
	$('#banner_action_montaj .countdown table tr:first-child td:nth-child(7)').html((''+secs).length > 1 ? secs : '0'+secs);

}
$(function(){
	updateActionMontajCountdown();
	setInterval(function(){ updateActionMontajCountdown(); }, 1000);

	$('#banner_action_montaj a.ask_for_call').click(function(){
		$('#banner_action_montaj .phone_name').show();
		$('#banner_action_montaj .phone_name :text[name=name]').focus();
		return false;
	});

	$('#banner_action_montaj .phone_name form').submit(function(){
		var params = { };
		var complete = true;
		$('#banner_action_montaj .phone_name :text').each(function(){
			if (!$(this).val()) {
				$(this).focus();
				complete = false;
				return false;
			} else {
				params[$(this).attr('name')] = $(this).val();
			}
		});
		if (!complete) {
			return false;
		}

		params['need_call'] = 1;
		$.post('send.php',params);

		$('#banner_action_montaj .phone_name').hide();
		return false;
	});
})
</script>

<div id='banner_action_montaj'>
	<div class='countdown'>
		<table>
			<tr>
				<td class=n></td>
				<td>:</td>
				<td class=n></td>
				<td>:</td>
				<td class=n></td>
				<td>:</td>
				<td class=n></td>
			</tr>
			<tr>
				<td>дней</td>
				<td></td>
				<td>часов</td>
				<td></td>
				<td>минут</td>
				<td></td>
				<td>секунд</td>
			</tr>
		</table>
	</div>
	<a href="/montaj" class='banner'></a>
	<a href="#" class='ask_for_call'></a>
	
	<div class='phone_name'>
		<form>
		<table>
			<tr>
				<td>Ваше имя: </td><td><input type=text name='name'></td>
			</tr>
			<tr>
				<td>Ваш телефон: </td><td><input type=text name='phone'></td>
			</tr>
			<tr>
				<td colspan=2 style="text-aligh:right;">
					<button type=submit>ПЕРЕЗВОНИТЕ МНЕ</button>	
				</td>
			</tr>
		</table>
		</form>
	</div>
</div>


